package com.ruoyi.invest.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.common.core.utils.DateUtils;
import com.ruoyi.invest.domain.TbInvestLog;
import com.ruoyi.invest.service.ITbInvestLogService;
import com.ruoyi.invest.mapper.TbInvestLogMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
* @author 86136
* @description 针对表【tb_invest_log(投资日志表)】的数据库操作Service实现
* @createDate 2023-01-13 11:18:49
*/
@Service
public class TbInvestLogServiceImpl implements ITbInvestLogService
{
    @Autowired
    private TbInvestLogMapper tbInvestLogMapper;

    /**
     * 查询投资日志
     *
     * @param investLogId 投资日志主键
     * @return 投资日志
     */
    @Override
    public TbInvestLog selectTbInvestLogByInvestLogId(Long investLogId)
    {
        return tbInvestLogMapper.selectTbInvestLogByInvestLogId(investLogId);
    }

    /**
     * 查询投资日志列表
     *
     * @param tbInvestLog 投资日志
     * @return 投资日志
     */
    @Override
    public List<TbInvestLog> selectTbInvestLogList(TbInvestLog tbInvestLog)
    {
        return tbInvestLogMapper.selectTbInvestLogList(tbInvestLog);
    }

    /**
     * 新增投资日志
     *
     * @param tbInvestLog 投资日志
     * @return 结果
     */
    @Override
    public int insertTbInvestLog(TbInvestLog tbInvestLog)
    {
        tbInvestLog.setCreateTime(DateUtils.getNowDate());
        return tbInvestLogMapper.insertTbInvestLog(tbInvestLog);
    }

    /**
     * 修改投资日志
     *
     * @param tbInvestLog 投资日志
     * @return 结果
     */
    @Override
    public int updateTbInvestLog(TbInvestLog tbInvestLog)
    {
        tbInvestLog.setUpdateTime(DateUtils.getNowDate());
        return tbInvestLogMapper.updateTbInvestLog(tbInvestLog);
    }

    /**
     * 批量删除投资日志
     *
     * @param investLogIds 需要删除的投资日志主键
     * @return 结果
     */
    @Override
    public int deleteTbInvestLogByInvestLogIds(Long[] investLogIds)
    {
        return tbInvestLogMapper.deleteTbInvestLogByInvestLogIds(investLogIds);
    }

    /**
     * 删除投资日志信息
     *
     * @param investLogId 投资日志主键
     * @return 结果
     */
    @Override
    public int deleteTbInvestLogByInvestLogId(Long investLogId)
    {
        return tbInvestLogMapper.deleteTbInvestLogByInvestLogId(investLogId);
    }
}




